package com.example.administrator.szb.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bumptech.glide.Glide;

/**
 * 首页轮播图的加载图片hodler,可以设置图片的加载方式
 * Created by Administrator on 2017/9/6.
 */

public class ImageViewHodler implements Holder<String> {
    ImageView imageView;
    @Override
    public View createView(Context context) {
        imageView = new ImageView(context);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        return imageView;
    }

    @Override
    public void UpdateUI(Context context, int position, String data) {
        //imageView.setImageResource(data);
        Glide.with(context).load(data).into(imageView);
    }
}
